# -*- coding: utf-8 -*-
import cv2 as cv
from mediapipe.python.solutions import drawing_utils, holistic

cap = cv.VideoCapture("videos/pose1.mp4")

mpHolistic = holistic.Holistic(static_image_mode=False)
mpDrawspec = drawing_utils.DrawingSpec(thickness=1, circle_radius=1)

while True:
    flag, frame = cap.read()

    frameRGB = cv.cvtColor(frame, cv.COLOR_BGR2RGB)
    results = mpHolistic.process(frameRGB)

    # drawing_utils.draw_landmarks(frame, results.face_landmarks, holistic.FACE_CONNECTIONS)
    # drawing_utils.draw_landmarks(frame, results.left_hand_landmarks, holistic.HAND_CONNECTIONS)
    # drawing_utils.draw_landmarks(frame, results.right_hand_landmarks, holistic.HAND_CONNECTIONS)
    # drawing_utils.draw_landmarks(frame, results.pose_landmarks, holistic.POSE_CONNECTIONS)
    drawing_utils.draw_landmarks(frame, results.face_landmarks, holistic.FACE_CONNECTIONS, mpDrawspec, mpDrawspec)
    drawing_utils.draw_landmarks(frame, results.left_hand_landmarks, holistic.HAND_CONNECTIONS, mpDrawspec, mpDrawspec)
    drawing_utils.draw_landmarks(frame, results.right_hand_landmarks, holistic.HAND_CONNECTIONS, mpDrawspec, mpDrawspec)
    drawing_utils.draw_landmarks(frame, results.pose_landmarks, holistic.POSE_CONNECTIONS, mpDrawspec, mpDrawspec)
    
    cv.imshow("video", frame)
    if cv.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv.destroyAllWindows()